<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="/WEB-INF/views/modules/commons/head.jsp" %>
    <!-- header -->
    <%@ include file="/WEB-INF/views/include/header.jsp" %>
    <style>
        .nav {
            margin-left: 0;
        }
        .nav > li > a:focus, .nav > li > a:hover {
            text-decoration: none;
            background-color: #33CCFF !important;
        }
        #main-container {
            padding: 50px 20px 0;
            position: relative;
            height: calc(100% - 71px);
            width: calc(100% - 19.5%);
            margin-left: 17.5%;
            margin-top: 60px;
        }
        .modal-dialog {
            z-index: 9999999;
        }
        @media (min-width: 768px) {
            .modal-content {
                -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
                box-shadow: 0 -2px 20px rgba(0, 0, 0, .5) !important;
            }
        }
    </style>
</head>
<body class="bgcolor">
<%@ include file="/WEB-INF/views/modules/commons/nav.jsp" %>
<%@ include file="/WEB-INF/views/modules/commons/menu.jsp" %>

<!-- /section:basics/navbar.layout -->
<table></table>
<div class="main-container" id="main-container">

    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <div class="pull-left">
                            <button class="btn btn-sm btn-info" id="showMailTable">查询通讯录</button>
                            <button class="btn btn-sm btn-success" id="showNodeTable">查询节点管理表</button>
                            <button class="btn btn-sm btn-default" id="showProjectTable">查询项目管理表</button>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <table id="gridTable"></table>
                        <div id="gridPager"></div>
                        <div style="display: none;">
                            <div class="row" id="queryDialog"></div>
                        </div>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>

</div><!-- /.main-container -->
</div>
<!-- footer -->
<script src="<s:url value="/assets/web/js/jquery.min.js?v=2.1.4"></s:url>"></script>
<link rel="stylesheet" href="<s:url value="/assets/web/css/login/bootstrap.min.css?v=3.3.6"></s:url>">
<script src="<s:url value="/assets/web/js/jqpaginator.min.js"></s:url>"></script>
<script src="<s:url value="/assets/web/js/baseAPI.js"></s:url>"></script>
<script src="<s:url value="/assets/web/common/bootstrapvalidator/dist/js/bootstrapValidator.js"></s:url>"></script>
<%@ include file="/WEB-INF/views/include/footer.jsp" %>
<!-- dialog -->
<%@ include file="/WEB-INF/views/include/dialog.jsp" %>

<script type="text/javascript">
    //基本路径
    var baseUrl = "<s:url value="/reportForm"></s:url>/"
    //jqgrid的表格高度
    var height = 320;
    //jqgrid表格行头的中文
    var colNames = ['', '项目名称', '节点名称', '基本情况', '计划用时'
        , '实际用时', '开始时间', '结束时间', '节点平均用时', '责任人'
        , '责任人电话', '经办人', '经办人电话', '责任单位', '逾期天数'
        , '发送短信次数'];
    var colModel = [
        {name: 'sysId', width: 60, hidden: true, key: true},
        {name: 'projectName', index: 'branch', width: 160, editable: true},
        {name: 'nodeName', index: 'role', width: 160, editable: true},
        {name: 'baseDetail', index: 'name', width: 160, editable: true},
        {name: 'planTime', index: 'phone', width: 160, editable: true},
        {name: 'factTime', width: 60, hidden: true, key: true},
        {name: 'planBeginDate', index: 'branch', width: 160, editable: true},
        {name: 'factFinishDate', index: 'role', width: 160, editable: true},
        {name: 'avTime', index: 'name', width: 160, editable: true},
        {name: 'resUser', index: 'phone', width: 160, editable: true},
        {name: 'resUserPhone', width: 60, hidden: true, key: true},
        {name: 'operatorUser', index: 'branch', width: 160, editable: true},
        {name: 'operatorPhone', index: 'role', width: 160, editable: true},
        {name: 'resDept', index: 'name', width: 160, editable: true},
        {name: 'earlyDays', index: 'phone', width: 160, editable: true},
        {name: 'messageNum', index: 'phone', width: 160, editable: true}
    ];
    //jqgrid的具体执行方法
    jqgrid({
        shrinkToFit:false,
        gridTableId : "#gridTable",
        gridPagerId : "#gridPager"
    });

    // 导出
    // var url ="/export/exportNodeDetail";
    // window.open(url);
    //通讯录
    $("#showMailTable").click(function () {
        window.location.href = '/reportForm1';
    });
    //节点报表
    $("#showNodeTable").click(function () {
        window.location.href = '/reportForm2';
    });
    // 项目报表
    $("#showProjectTable").click(function () {
        window.location.href = '/reportForm3';
    });
    //登录报表
    $("#exportMailList").click(function () {
        showDialog({
            dialogTitle: '查询设置',
            dialogBody: queryDialog,
            dialogFoot: "<button type='button' class='btn btn-primary' onclick='query()'>查询</button>" +
                "<button type='button' class='btn btn-pink' onclick='reset()'>重置</button>" +
                "<button type='button' class='btn btn-default' data-dismiss='modal'>关闭</button>"
        });
    });
    //加载查询对话框
    $("#queryDialog").load(getUrl("filter"));
    //显示查询对话框
    var queryDialog = $("#queryDialog");
    //左边菜单选中处理
    $(function () {
        $(".nav>li:nth-child(8)").addClass("active");
    })
    //重置表单
    function reset() {
        resetForm("#formDialog form");
    }
    //具体查询方法
    function query() {
        exportData = $('#formDialog form').serialize();
        seachJqgird("#gridTable", "#formDialog form");
        $("#formDialog").modal('hide');
    }
    //具体查询方法
    function query1() {
         exportData = $('#formDialog form').serialize();
         colNames = ['', '单位', '角色', '姓名', '联系电话'];
         colModel = [
            {name: 'sysId', width: 60, hidden: true, key: true},
            {name: 'branch', index: 'branch', width: 160, editable: true},
            {name: 'role', index: 'role', width: 160, editable: true},
            {name: 'name', index: 'name', width: 160, editable: true},
            {name: 'phone', index: 'phone', width: 160, editable: true},
            {name: 'branchType', width: 60, hidden: true, key: true}
        ];
        seachJqgird("#gridTable", "#formDialog form");
        $("#formDialog").modal('hide');
    }
</script>

</body>
</html>